﻿using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class DbHelper
    {
        /// <summary>
        /// Determines whether the connection is available.
        /// </summary>
        /// <returns>
        /// 	<c>true</c> if the connection is available; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsConnectionAvailable()
        {
            var available = true;
            var connection = new SQLiteConnection(Connection.CatalogConnection);
            try
            {
                connection.Open();
            }
            catch(Exception)
            {
                available = false;
            }
            return available;
        }
    }
}
